<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> 
<%String path = request.getContextPath();%>
<script type="text/javascript" src="<%=path%>/projectjs/affichejs.js"></script>
<script>
	function showAppPage(){
		var mode = $("#affiche_mode").val();
		if(mode==1){//选择APP客户端时
			$("#affich_area").css("display","none");
		}else{
			$("#affich_area").css("display","block");
		}
	}
</script>
	<div class="pageContent">
		<form method="post" action="<%=path%>/affiche/saveAffiche.action" class="pageForm required-validate" onsubmit="return setAfficheVOValue(this);">
			<input type="hidden" name="afficheVO.area" id="hiddenArea" value="${afficheVO.area}" til="请选择公告区域！"/>
			<input type="hidden" name="afficheVO.id" value="${afficheVO.id}"/>
			<div class="pageFormContent" layoutH="56">
				<p>
					<label>公告标题：</label>
					<input name="afficheVO.title" value="${afficheVO.title}" class="required" type="text" size="30" alt="请输入标题"/>
				</p>
				<div class="divider" style="border:0;"></div>
				<fieldset>
					<dl class="nowrap">
						<dt>简介：</dt>
						<dd>
						<textarea class="textInput" rows="2" cols="40" name="afficheVO.titleShow" style="width: 510px; height: 40px;"><s:property value="afficheVO.titleShow" /></textarea>
						</dd>
					</dl>
				</fieldset>
				<p>
					<label>公告渠道：</label>
					<select id="affiche_mode" name="afficheVO.mode" class="required combox" onchange="showAppPage();">
						<option value="0"${afficheVO.mode==0?" selected='true'":""}>WEB前台</option>
						<option value="1"${afficheVO.mode==1?" selected='true'":""}>APP客户端</option>
						<option value="2"${afficheVO.mode==2?" selected='true'":""}>WEB后台</option>
					</select>
				</p>
				<p style="width: 96%">
					<label>公告内容：</label>
					<div class="unit">
						<textarea class="editor" name="afficheVO.content" rows="10" cols="100" id="contentID" til="请编写公告内容！">${afficheVO.content}</textarea>
					</div>
				</p>
				<p id="affich_area" style="width: 96%;${afficheVO.mode==1?'display:none':''}">
					<label>公告区域：</label>
					<input type="radio" name="afficheVO.bound" value="0" onclick="document.getElementById('area_div').style.display='none';"${afficheVO.bound==0?" checked='true'":""}/>全部
					<input type="radio" name="afficheVO.bound" value="1" onclick="document.getElementById('area_div').style.display='block';"${afficheVO.bound==1?" checked='true'":""}/>选择区域
				</p>
				<div id="area_div" style="width:98%;display:${afficheVO.bound==0?'none;':'block'}">
				<s:iterator value="regioninfoList" id="area">
				<div style="padding-left: 10px;width:96%">
				<div>
					<h1 style="overflow: hidden;float: left;">${area.region}<input type="checkbox" value="${area.regionId}" onclick="checkedInput(this,${area.regionId});"<s:if test="afficheVO.bound==1&&afficheVO.area.indexOf(#area.regionId.toString())!=-1"> checked="true"</s:if>/></h1>
					<a class="button" href="javascript:;" onclick="clickPanelExtend(this,${area.regionId},0,0);" style="float: left;margin-left: 30px;font-size: 30px;font-weight: bold;"><span>+</span></a>
				</div>
				<div class="divider"></div>
				<div id="${area.regionId}_div" style="display: none;margin-left: 30px" open="no"></div>
				</div>
			</s:iterator>
				</div>
			</div>
			<div class="formBar">
				<ul>
					<li><div class="buttonActive"><div class="buttonContent"><button type="submit">保存</button></div></div></li>
					<li>
						<div class="button"><div class="buttonContent"><button type="button" class="close">取消</button></div></div>
					</li>
				</ul>
			</div>
		</form>
	</div>